@extends('layouts.app')
@section('title','客服设置')
@section('content')

<!-- start: Content -->
<div class="row-fluid">
	<div class="box span12">
		<div class="box-header">
			<h2><i class="icon-edit"></i>升级会员设置</h2>
		</div>
		<div class="box-content">
		@if($uservip == null)
			<form action="{{ URL('app/user/vip') }}" method='POST'  enctype="multipart/form-data" class="form-horizontal" style='height:3000px;'>
				{{ csrf_field() }}
			   <fieldset>
				<div class="control-group">
				  <label class="control-label" for="typeahead">会员介绍标题:</label>
				  <div class="controls">
					<input type="text" name='title' class="span6 typeahead" maxlength="10"/>
					<p class="help-block" style='color:red;'>会员介绍标题最多可以输入10字!</p>
				  </div>
				</div>
				<div class="control-group hidden-phone">
				  <label class="control-label" for="textarea2">会员介绍内容:</label>
				  <div class="controls">
					<script id="ue-container" style='width:680px;height:300px;' name="content"  type="text/plain"></script>
					<p class="help-block" style='color:red;'>注：图片比例为1：1，图片尺寸为360*360、720*720（参考），图片格式可为JPG，PNG</p>
				  </div>
				</div>
				<div class="control-group">
				  <label class="control-label" for="typeahead">会员价格（元）:</label>
				  <div class="controls">
					<input type="text" name='money' style='width:300px;' class="span6 typeahead" maxlength="11"/>
				  </div>
				</div>
				<div class="form-actions">
				  <button type="submit" class="btn btn-primary">确定</button>
				</div>
			  </fieldset>
			</form> 
		@else
			<form id='is' action="{{ URL('app/user/vip',$uservip->id) }}" method='POST' style='display: none;'  enctype="multipart/form-data" class="form-horizontal" style='height:3000px;'>
				{{ csrf_field() }}
				{{ method_field('PUT') }}
			  <fieldset>
				<div class="control-group">
				  <label class="control-label" for="typeahead">会员介绍标题:</label>
				  <div class="controls">
					<input type="text" name='title' class="span6 typeahead" maxlength="10" value='{{ $uservip->title }}'/>
					<p class="help-block" style='color:red;'>会员介绍标题最多可以输入10字!</p>
				  </div>
				</div>
				<div class="control-group hidden-phone">
				  <label class="control-label" for="textarea2">会员介绍内容:</label>
				  <div class="controls">
					<script id="ue-container" style='width:680px;height:300px;' name="content"  type="text/plain">{!! $uservip->content !!}</script>
					<p class="help-block" style='color:red;'>注：图片比例为1：1，图片尺寸为360*360、720*720（参考），图片格式可为JPG，PNG</p>
				  </div>
				</div>
				<div class="control-group">
				  <label class="control-label" for="typeahead">会员价格（元）:</label>
				  <div class="controls">
					<input type="text" name='money' style='width:300px;' class="span6 typeahead" value='{{ $uservip->price }}' maxlength="11"/>
				  </div>
				</div>
				<div class="form-actions">
				  <button type="submit" class="btn btn-primary">确定</button>
				  <span class="btn btn-danger" onclick="guanbi(this)">取消</button>
				</div>
			  </fieldset>
			</form> 

			<form id='this' enctype="multipart/form-data" class="form-horizontal" style='height:3000px;'>
			  <fieldset>
				<div class="control-group">
				  <label class="control-label" for="typeahead">会员介绍标题:</label>
				  <div class="controls">
					<input type="text" name='title' class="span6 typeahead" value='{{ $uservip->title }}' maxlength="10" readonly />
					<p class="help-block" style='color:red;'>会员介绍标题最多可以输入10字!</p>
				  </div>
				</div>
				<div class="control-group hidden-phone">
				  <label class="control-label" for="textarea2">会员介绍内容:</label>
				  <div class="controls">
					{!! $uservip->content !!}
				  </div>
				</div>
				<div class="control-group">
				  <label class="control-label" for="typeahead">会员价格（元）:</label>
				  <div class="controls">
					<input type="text" name='money' style='width:300px;' value='{{ $uservip->price }}' class="span6 typeahead" maxlength="11" readonly />
				  </div>
				</div>
				<div class="form-actions">
				  <span class="btn btn-primary" onclick="edit(this)">编辑</span>
				</div>
			  </fieldset>
			</form> 
		@endif  
		</div>
	</div><!--/span-->
</div><!--/row-->
<!-- end: Content -->
<script type="text/javascript">
    var ue = UE.getEditor('ue-container');
    ue.ready(function(){
        ue.execCommand('serverparam', '_token', '{{ csrf_token() }}');
    });
</script>
@stop
<script type="text/javascript">
		
		function edit(o){

			document.getElementById("is").style.display = '';
			document.getElementById("this").style.display = 'none';

		}

		function guanbi(o){
			document.getElementById("this").style.display = '';
			document.getElementById("is").style.display = 'none';
			
		}
</script>